ClientPlayNetworkContext

class ClientPlayNetworkContext(context: ClientPlayNetworking.Context) : NetworkContext<ClientPlayerEntity>

A client-side network context, used to handle S2C payloads

Author

fzzyhmstrs

Since

0.4.1

Constructors

Link copied to clipboard
constructor(context: ClientPlayNetworking.Context)

Functions

Link copied to clipboard
open override fun canReply(id: Identifier): Boolean

Check for whether you can reply with a certain payload type (Typically this is CustomPayload.Id#id)

Link copied to clipboard
open override fun disconnect(reason: Text)

Disconnects the current session (single or multiplayer)

Link copied to clipboard
open override fun execute(runnable: Runnable)

Executes a task on the main thread. This should be used for anything interacting with game state outside the network loop

Link copied to clipboard
open override fun networkPhase(): NetworkPhase

The current network phase. Always PLAY at the moment.

Link copied to clipboard
open override fun networkSide(): NetworkSide

The network side of this context. Responses will be SERVERBOUND

Link copied to clipboard
open override fun player(): ClientPlayerEntity

The player entity associated with this context. A client player in this case.

Link copied to clipboard
open override fun reply(payload: CustomPayload)

Replies to a payload with an opposite-direction response (C2S in this case)